package com.ruoyi.system.service.yanglao.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.yanglao.YlNoticeMapper;
import com.ruoyi.system.domain.yanglao.YlNotice;
import com.ruoyi.system.service.yanglao.IYlNoticeService;

/**
 * 通知公告Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-06-14
 */
@Service
public class YlNoticeServiceImpl implements IYlNoticeService 
{
    @Autowired
    private YlNoticeMapper ylNoticeMapper;

    /**
     * 查询通知公告
     * 
     * @param id 通知公告主键
     * @return 通知公告
     */
    @Override
    public YlNotice selectYlNoticeById(Long id)
    {
        return ylNoticeMapper.selectYlNoticeById(id);
    }

    /**
     * 查询通知公告列表
     * 
     * @param ylNotice 通知公告
     * @return 通知公告
     */
    @Override
    public List<YlNotice> selectYlNoticeList(YlNotice ylNotice)
    {
        return ylNoticeMapper.selectYlNoticeList(ylNotice);
    }

    /**
     * 新增通知公告
     * 
     * @param ylNotice 通知公告
     * @return 结果
     */
    @Override
    public int insertYlNotice(YlNotice ylNotice)
    {
        ylNotice.setCreateTime(DateUtils.getNowDate());
        return ylNoticeMapper.insertYlNotice(ylNotice);
    }

    /**
     * 修改通知公告
     * 
     * @param ylNotice 通知公告
     * @return 结果
     */
    @Override
    public int updateYlNotice(YlNotice ylNotice)
    {
        ylNotice.setUpdateTime(DateUtils.getNowDate());
        return ylNoticeMapper.updateYlNotice(ylNotice);
    }

    /**
     * 批量删除通知公告
     * 
     * @param ids 需要删除的通知公告主键
     * @return 结果
     */
    @Override
    public int deleteYlNoticeByIds(Long[] ids)
    {
        return ylNoticeMapper.deleteYlNoticeByIds(ids);
    }

    /**
     * 删除通知公告信息
     * 
     * @param id 通知公告主键
     * @return 结果
     */
    @Override
    public int deleteYlNoticeById(Long id)
    {
        return ylNoticeMapper.deleteYlNoticeById(id);
    }
}
